home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / glibc-1.09 / glibc-1 / glibc-1.09.1 / mach / errorlib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-18  |  2.4 KB  |  88 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1991,1990,1989 Carnegie Mellon University
  4.  * All Rights Reserved.
  5.  * 
  6.  * Permission to use, copy, modify and distribute this software and its
  7.  * documentation is hereby granted, provided that both the copyright
  8.  * notice and this permission notice appear in all copies of the
  9.  * software, derivative works or modified versions, and any portions
  10.  * thereof, and that both notices appear in supporting documentation.
  11.  * 
  12.  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS 
  13.  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14.  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15.  * 
  16.  * Carnegie Mellon requests users of this software to return to
  17.  * 
  18.  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  19.  *  School of Computer Science
  20.  *  Carnegie Mellon University
  21.  *  Pittsburgh PA 15213-3890
  22.  * 
  23.  * any improvements or extensions that they make and grant Carnegie the
  24.  * rights to redistribute these changes.
  25.  */
  26. /*
  27.  * HISTORY
  28.  * $Log: errorlib.h,v $
  29.  * Revision 1.4  1993/12/17  21:56:16  roland
  30.  * entered into RCS
  31.  *
  32.  * Revision 2.3  92/03/31  15:18:52  rpd
  33.  *     Added KERN_DEVICE_MOD for device errors.
  34.  *     [92/03/09            rpd]
  35.  * 
  36.  * Revision 2.2  92/01/16  00:21:17  rpd
  37.  *     Moved from user collection to mk collection.
  38.  * 
  39.  * Revision 2.2  91/03/27  15:37:37  mrt
  40.  *     First checkin
  41.  * 
  42.  */
  43. /*
  44.  *    File:    errorlib.h
  45.  *    Author:    Douglas Orr, Carnegie Mellon University
  46.  *    Date:    Mar. 1988
  47.  *
  48.  *    Error bases for subsytems errors.
  49.  */
  50.  
  51. #include <mach/error.h>
  52.  
  53. #define KERN_DEVICE_MOD        (err_kern|err_sub(1))
  54.  
  55. #define BOOTSTRAP_FS_MOD    (err_bootstrap|err_sub(0))
  56.  
  57. #define    MACH_IPC_SEND_MOD    (err_mach_ipc|err_sub(0))
  58. #define    MACH_IPC_RCV_MOD    (err_mach_ipc|err_sub(1))
  59. #define    MACH_IPC_MIG_MOD    (err_mach_ipc|err_sub(2))
  60.  
  61. #define    IPC_SEND_MOD        (err_ipc|err_sub(0))
  62. #define    IPC_RCV_MOD        (err_ipc|err_sub(1))
  63. #define    IPC_MIG_MOD        (err_ipc|err_sub(2))
  64.  
  65. #define    SERV_NETNAME_MOD    (err_server|err_sub(0))
  66. #define    SERV_ENV_MOD        (err_server|err_sub(1))
  67. #define    SERV_EXECD_MOD        (err_server|err_sub(2))
  68.  
  69.  
  70. #define    NO_SUCH_ERROR        "unknown error code"
  71.  
  72. struct error_subsystem {
  73.     const char        * subsys_name;
  74.     int            max_code;
  75.     const char        * const * codes;
  76. };
  77.  
  78. struct error_system {
  79.     int            max_sub;
  80.     const char        * bad_sub;
  81.     const struct error_subsystem    * subsystem;
  82. };
  83.  
  84. #define errors __mach_error_systems
  85. extern    struct error_system     errors[err_max_system+1];
  86.  
  87. #define    errlib_count(s)        (sizeof(s)/sizeof(s[0]))
  88.